Skip to content

Check more property for pre-created subnet#1428

Open
TaoZou1 wants to merge 1 commit into
vmware-tanzu:mainfrom
TaoZou1:validatesubnetset
Open

Check more property for pre-created subnet#1428
TaoZou1 wants to merge 1 commit into
vmware-tanzu:mainfrom
TaoZou1:validatesubnetset

Conversation

@TaoZou1
Copy link
Copy Markdown
Contributor

@TaoZou1 TaoZou1 commented May 9, 2026

Verify that DHCP mode and static IP allocation are identical across all pre-created subnets in the SubnetSet.

Test Done:
create subnet1, subnet2, subnet3
subnet 1
"advanced_config" : {
"static_ip_allocation" : {
"enabled" : true
},
"connectivity_state" : "CONNECTED"
},
"subnet_dhcp_config" : {
"mode" : "DHCP_DEACTIVATED"
},
subnet 2:
"advanced_config" : {
"static_ip_allocation" : {
"enabled" : false
},
"connectivity_state" : "CONNECTED"
},
"subnet_dhcp_config" : {
"mode" : "DHCP_SERVER"
},
subnet 3:
"advanced_config" : {
"static_ip_allocation" : {
"enabled" : false
},
"connectivity_state" : "CONNECTED"
},
"subnet_dhcp_config" : {
"mode" : "DHCP_DEACTIVATED"
},

Test case 1:

  1. update the vpcnetworkconfiguration with
    subnets:
  • name: subnet2
    path: /orgs/default/projects/project-quality/vpcs/test1/subnets/subnet2
    podDefault: true
  • name: subnet1
    path: /orgs/default/projects/project-quality/vpcs/test1/subnets/subnet1
    podDefault: true
  1. check the pod-default subnetset:
    status:
    conditions:
  • lastTransitionTime: "2026-05-09T01:30:34Z"
    message: SubnetSet CR has been successfully created/updated
    reason: SubnetSetReady
    status: "True"
    type: Ready
  • lastTransitionTime: "2026-05-09T01:39:31Z"
    message: 'admission webhook "subnetset.validating.crd.nsx.vmware.com" denied the
    request: Subnets in SubnetSet ns2/pod-default must have the same DHCPConfigMode,
    found different DHCPConfigModes: [DHCPServer, DHCPDeactivated]'
    reason: SubnetNamesUpdateFailure

Test case 2:

  1. update the vpcnetworkconfiguration with
    subnets:
  • name: subnet3
    path: /orgs/default/projects/project-quality/vpcs/test1/subnets/subnet2
    podDefault: true
  • name: subnet1
    path: /orgs/default/projects/project-quality/vpcs/test1/subnets/subnet1
    podDefault: true
  1. check the pod-default subnetset:
    status:
    conditions:
  • lastTransitionTime: "2026-05-09T01:30:34Z"
    message: SubnetSet CR has been successfully created/updated
    reason: SubnetSetReady
    status: "True"
    type: Ready
  • lastTransitionTime: "2026-05-09T01:42:05Z"
    message: 'admission webhook "subnetset.validating.crd.nsx.vmware.com" denied the
    request: Subnets in SubnetSet ns2/pod-default must have the same StaticIPAllocation,
    found different StaticIPAllocations: [false, true]'
    reason: SubnetNamesUpdateFailure
    status: "True"
    type: UpdateFailed

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 9, 2026

Codecov Report

❌ Patch coverage is 72.72727% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.01%. Comparing base (73f6e84) to head (7cdef28).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controllers/subnetset/subnetset_webhook.go 72.72% 0 Missing and 6 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1428      +/-   ##
==========================================
+ Coverage   76.99%   77.01%   +0.01%     
==========================================
  Files         154      156       +2     
  Lines       21993    22064      +71     
==========================================
+ Hits        16934    16992      +58     
- Misses       3855     3859       +4     
- Partials     1204     1213       +9     
Flag Coverage Δ
unit-tests 77.01% <72.72%> (+0.01%) ⬆️
Files with missing lines Coverage Δ
pkg/controllers/subnetset/subnetset_webhook.go 76.78% <72.72%> (-1.58%) ⬇️

... and 13 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TaoZou1
Copy link
Copy Markdown
Contributor Author

TaoZou1 commented May 12, 2026

/e2e

3 similar comments
@TaoZou1
Copy link
Copy Markdown
Contributor Author

TaoZou1 commented May 12, 2026

/e2e

@TaoZou1
Copy link
Copy Markdown
Contributor Author

TaoZou1 commented May 14, 2026

/e2e

@TaoZou1
Copy link
Copy Markdown
Contributor Author

TaoZou1 commented May 19, 2026

/e2e

Comment thread pkg/controllers/subnetset/subnetset_webhook.go
Comment thread pkg/controllers/subnetset/subnetset_webhook.go Outdated
Comment thread pkg/controllers/subnetset/subnetset_webhook.go Outdated
@TaoZou1 TaoZou1 force-pushed the validatesubnetset branch from 174b953 to 4f900df Compare May 20, 2026 02:50
Verify that DHCP mode and static IP allocation are identical across all
pre-created subnets in the SubnetSet.
@TaoZou1 TaoZou1 force-pushed the validatesubnetset branch from 4f900df to 7cdef28 Compare May 20, 2026 02:58
Copy link
Copy Markdown
Contributor

@yanjunz97 yanjunz97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TaoZou1
Copy link
Copy Markdown
Contributor Author

TaoZou1 commented May 21, 2026

/e2e

1 similar comment
@TaoZou1
Copy link
Copy Markdown
Contributor Author

TaoZou1 commented May 21, 2026

/e2e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants